import axios from 'axios';
import {Message} from 'element-ui';

axios.interceptors.request.use(config => {
    return config;
}, error => {
    return Promise.reject(error);
});

axios.interceptors.response.use(
    response => {
        return response;
    },
    error => {
        if (error.response) {
        switch (error.response.status) {
            case 500:
                Message.success('test')
            break;
        }
    }
    return Promise.reject(error.response.data)
});
